home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 10 Scripting / 01 Berger / Opcode.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-14  |  571 b   |  25 lines

  1. #ifndef __Opcode_H__
  2. #define __Opcode_H__
  3.  
  4.  
  5. // This enumeration defines the set of opcodes that the interpreter
  6. // understands.  The code generator needs to use this enumeration to generate
  7. // the proper bytecode stream.
  8. enum Opcode {
  9.   // Define the four basic math opcodes.
  10.   Add_Opcode,
  11.   Subtract_Opcode,
  12.   Multiply_Opcode,
  13.   Divide_Opcode,
  14.  
  15.   // Push & pop add and remove a value from the interpreter's stack.
  16.   Push_Opcode,
  17.   Pop_Opcode,
  18.  
  19.   // This simply defines the maximum number of opcodes used.
  20.   Num_Opcode
  21. };
  22.  
  23.  
  24. #endif // __Opcode_H__
  25.